﻿<!--
 Peter
 Created by: Peter Development Team
    http://peter.codeplex.com/
 
 GNU General Public License version 2 (GPLv2)
    http://peter.codeplex.com/license
 
  This code is provided on an AS IS basis, with no WARRANTIES,
  CONDITIONS or GUARANTEES of any kind.
-->
<UserControl x:Class="Peter.View.ViewOptions"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:logic="clr-namespace:Peter.Logic"
             xmlns:icons="clr-namespace:Peter.Common.Icons;assembly=Peter.Common"
             xmlns:bc="clr-namespace:Peter.Common.BindingConverters;assembly=Peter.Common"
             mc:Ignorable="d"
             d:DataContext="{d:DesignInstance logic:ModelOptions}"
             d:DesignHeight="300"
             d:DesignWidth="300"
             Background="{DynamicResource BackgroundBrush}">
   
   <UserControl.Resources>
      <bc:ViewRegistryConverter x:Key="_ViewConverter" />
   </UserControl.Resources>

   <Grid Margin="20">
      <Grid.RowDefinitions>
         <RowDefinition Height="Auto" />
         <RowDefinition Height="*" />
      </Grid.RowDefinitions>

      <StackPanel Grid.Row="0"
                  Orientation="Horizontal">
         <icons:IconDisplay IconSize="Large"
                            Icon="Cog" />
         <TextBlock Text="Peter Options"
                    FontWeight="Bold"
                    FontSize="18"
                    Margin="5,0,0,0"/>
      </StackPanel>
      
      <Grid Margin="0,10,0,0"
            Grid.Row="1">
         <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" />
         </Grid.ColumnDefinitions>

         <ListBox Grid.Column="0"
                  Margin="0,0,10,0"
                  x:Name="_OptionList"
                  MinWidth="100"
                  SelectedItem="{Binding Path=SelectedItem, Mode=TwoWay}"
                  ItemsSource="{Binding Path=OptionPages}">
            <!--<ListBox.ItemContainerStyle>
            <Style TargetType="{x:Type ListBoxItem}">
               <Setter Property="FontWeight"
                       Value="Normal" />
               <Style.Triggers>
                  <Trigger Property="IsSelected"
                           Value="True">
                     <Setter Property="FontWeight"
                             Value="Bold" />
                  </Trigger>
               </Style.Triggers>
            </Style>
         </ListBox.ItemContainerStyle>-->

            <ListBox.ItemTemplate>
               <DataTemplate DataType="ListBoxItem">
                  <Grid HorizontalAlignment="Center"
                        MinWidth="100">
                     <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                     </Grid.RowDefinitions>
                     <icons:IconDisplay Icon="{Binding Path=OptionPageIcon}"
                                        Grid.Row="0"
                                        x:Name="PART_Icon"
                                        IconSize="Largest" />
                     <TextBlock Margin="4,10,4,5"
                                Grid.Row="1"
                                HorizontalAlignment="Center"
                                Text="{Binding Path=Name}" />
                  </Grid>
               </DataTemplate>
            </ListBox.ItemTemplate>

         </ListBox>

         <ScrollViewer HorizontalScrollBarVisibility="Auto"
                       VerticalScrollBarVisibility="Auto"
                       Grid.Column="1">
            <ContentControl Content="{Binding ElementName=_OptionList, Path=SelectedItem, Converter={StaticResource _ViewConverter}}" />
         </ScrollViewer>

      </Grid>
   </Grid>
</UserControl>
